import { ApiProperty, PartialType } from '@nestjs/swagger';
import { IsOptional, IsNotEmpty } from 'class-validator';

export class DepartDto {
  @ApiProperty({ description: '部门名称' })
  @IsNotEmpty({ message: '部门名称不能为空' })
  departName: string;

  @ApiProperty({ description: '父部门id' })
  parentId: string;

  @ApiProperty({ description: '排序id' })
  sort: number;
}

export class DepartUpdateDto extends PartialType(DepartDto) {
  @ApiProperty({ description: 'id' })
  @IsOptional()
  id?: string;
}
